package edu.ts.crowdfunding.product.mapper;

import edu.ts.crowdfunding.product.domain.PO.ConditionalQueryPO;
import edu.ts.crowdfunding.product.domain.Product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【project】的数据库操作Mapper
* @createDate 2025-06-25 09:44:16
* @Entity edu.ts.crowdfunding.product.domain.Product
*/
@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    List<Product> pageSearch(ConditionalQueryPO conditionalQueryPO);

    Product getProductRef(Long id);

    @Select("select category_Id from project_category where category_id = #{categoryId}")
    Long getCategory(Long categoryId);

    @Delete("delete from project where category_id = #{id}")
    void deleteProductById(Long id);
}




